<?php

namespace common\model;

use think\model\RelationModel;
use teamones\dbeventObserver\SplSubjectEnforcer;
use teamones\dbeventObserver\interfaces\SplSubject;

class ProjectCapacityReportDailyModel extends RelationModel implements SplSubject
{
    use SplSubjectEnforcer;

    // 自动验证
    protected $_validate = [
        ['project_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['step_category_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['number', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段

        ['number_logic', '1,128', '', self::EXISTS_VALIDATE, 'length'],

    ];


    // 自动完成
    protected $_auto = [
        ['tenant_id', 'auto_fill_tenant_id', self::MODEL_INSERT, 'function'],

        ['created_by', 'fill_created_by', self::MODEL_INSERT, 'function'],
        ['updated_by', 'fill_created_by', self::MODEL_UPDATE, 'function'],
        ['created', 'time', self::MODEL_INSERT, 'function'],
        ['updated', 'time', self::MODEL_UPDATE, 'function'],
    ];
}
